package lu.med.praxiswahl.wahlumed.client.gravtest;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

/**
 * 
 * @author Lars Holger Roth
 */
@SuppressWarnings("serial")
public class GravTestButtonPos extends JButton implements ActionListener
{
    private GravTestDataModel model;

    public GravTestButtonPos(GravTestDataModel model, int mode)
    {
	super("");
	this.model = model;
	this.addActionListener(this);
    }

    public void actionPerformed(ActionEvent e)
    {
	model.setPositiv();
    }

    @Override
    public void paint(Graphics g)
    {
	super.paint(g);
	g.setColor(new Color(0, 0, 0));
	int w = this.getHeight() - 6;
	g.drawOval(this.getWidth() / 2 - w / 2, 3, w, w - 1);
	g.setColor(new Color(250, 0, 0));
	g.drawString("+", this.getWidth() / 2 - 2, w - 2);
    }
}
